package com.kd.juhaowan.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.kd.juhaowan.ui.listener.SoftKeyBoardListener;


public abstract class BottomConfirmActivity extends BaseActivity implements SoftKeyBoardListener.OnSoftKeyBoardChangeListener {

    protected abstract View getBottomConfirmView();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        SoftKeyBoardListener.setListener(this,this);
    }


    @Override
    public void keyBoardShow(int height) {
        View view = getBottomConfirmView();
        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)view.getLayoutParams();
        params.bottomMargin = height;
        view.setLayoutParams(params);
    }

    @Override
    public void keyBoardHide(int height) {
        View view = getBottomConfirmView();
        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)view.getLayoutParams();
        params.bottomMargin = 0;
        view.setLayoutParams(params);
    }
}
